<?php
/**
 * @author Wayne
* @copyright Jiuchi Information Technology Co.,Ltd
*/
?>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<?php $this->load->view('admin/common/head')//,$head);?>
	</head>
	<body class="no-skin">
		<!-- #section:basics/navbar.layout -->
		<div id="navbar" class="navbar navbar-default navbar-collapse h-navbar">
			<?php $this->load->view('admin/common/navbar', $adminname)?>
		</div>

		<!-- /section:basics/navbar.layout -->
		<div class="main-container" id="main-container">
			

			<!-- /section:basics/sidebar.horizontal -->
			<div class="main-content">
				<?php $this->load->view('admin/common/menu',array('tag' => 1))?>
				<div class="main-content-inner">
					<div class="page-content">
						<div class="page-header">
							<h1>
								学校管理
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
									<?php echo (isset($school['id']) && $school['id'])?'编辑学校#'.$school['id']:'新建学校';?>
								</small>
							</h1>
						</div>

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<form class="form-horizontal" role="form" action="<?php $tmp = isset($school['id'])?'/'.$school['id']:''; echo site_url('admin/school_management/editPost').$tmp;?>" method="post" enctype="multipart/form-data">
									<?php
										if(isset($school['id']) && $school['id']){//if we can get the school id
									?>
									<div class="form-group">
										<label class="col-sm-3 no-padding-right control-label">学校欢迎图片</label>
										<div class="col-sm-4">
											<img width="100%" src="<?php echo '/uploads/group_title_'.$school['id'].'.png'.'?t='.time()?>">
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 no-padding-right control-label">上传PNG文件</label>
										<div class="col-sm-4">
											<!-- #section:custom/file-input -->
											<input type="file" name="filename" id="id-input-file-2"/>
										</div>
									</div>
									<hr />
									<?php
										}
									?>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="name">学校名称</label>
	
										<div class="col-sm-9">
											<input type="text" id="name" name="name" placeholder="学校名称" class="col-xs-10 col-sm-5" value="<?php echo isset($school['name'])?$school['name']:''?>"/>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="address">学校详细地址</label>
	
										<div class="col-sm-9">
											<input type="text" id="address" name="address" placeholder="学校详细地址" class="col-xs-10 col-sm-5" value="<?php echo isset($school['address'])?$school['address']:''?>"/>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="contact_name">联系人</label>
	
										<div class="col-sm-9">
											<input type="text" id="contact_name" name="contact_name" placeholder="联系人" class="col-xs-10 col-sm-5" value="<?php echo isset($school['contact_name'])?$school['contact_name']:''?>"/>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="contact_phone">联系电话</label>
	
										<div class="col-sm-9">
											<input type="text" id="contact_phone" name="contact_phone" placeholder="联系电话" class="col-xs-10 col-sm-5" value="<?php echo isset($school['contact_phone'])?$school['contact_phone']:''?>"/>
										</div>
									</div>
									<div class="center">
										<button id="btn-back" type="button" class="btn btn-sm btn-danger" onclick="window.location='<?php echo site_url('admin/school_management');?>'">
											<i class="ace-icon fa fa-reply bigger-110"></i>
											返回
										</button>
										<button type="submit" class="btn btn-sm btn-success">
											提交
											<i class="ace-icon fa fa-check icon-on-right bigger-110"></i>
										</button>
									</div>
								</form>
								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->

		<?php $this->load->view('admin/common/footer')?>
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script type="text/javascript">
			window.jQuery || document.write("<script src='/assets/ace/js/jquery.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='/assets/ace/js/jquery1x.js'>"+"<"+"/script>");
</script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='/assets/ace/js/jquery.mobile.custom.js'>"+"<"+"/script>");
		</script>
		<script src="/assets/ace/js/bootstrap.js"></script>

		<!-- page specific plugin scripts -->


		<!-- ace scripts -->
		<script src="/assets/ace/js/ace/elements.scroller.js"></script>
		<script src="/assets/ace/js/ace/elements.colorpicker.js"></script>
		<script src="/assets/ace/js/ace/elements.fileinput.js"></script>
		<script src="/assets/ace/js/ace/elements.typeahead.js"></script>
		<script src="/assets/ace/js/ace/elements.wysiwyg.js"></script>
		<script src="/assets/ace/js/ace/elements.spinner.js"></script>
		<script src="/assets/ace/js/ace/elements.treeview.js"></script>
		<script src="/assets/ace/js/ace/elements.wizard.js"></script>
		<script src="/assets/ace/js/ace/elements.aside.js"></script>
		<script src="/assets/ace/js/ace/ace.js"></script>
		<script src="/assets/ace/js/ace/ace.ajax-content.js"></script>
		<script src="/assets/ace/js/ace/ace.touch-drag.js"></script>
		<script src="/assets/ace/js/ace/ace.sidebar.js"></script>
		<script src="/assets/ace/js/ace/ace.sidebar-scroll-1.js"></script>
		<script src="/assets/ace/js/ace/ace.submenu-hover.js"></script>
		<script src="/assets/ace/js/ace/ace.widget-box.js"></script>
		<script src="/assets/ace/js/ace/ace.settings.js"></script>
		<script src="/assets/ace/js/ace/ace.settings-rtl.js"></script>
		<script src="/assets/ace/js/ace/ace.settings-skin.js"></script>
		<script src="/assets/ace/js/ace/ace.widget-on-reload.js"></script>
		<script src="/assets/ace/js/ace/ace.searchbox-autocomplete.js"></script>

		<!-- inline scripts related to this page -->
		<script type="text/javascript">
			jQuery(function($) {
			 var $sidebar = $('.sidebar').eq(0);
			 if( !$sidebar.hasClass('h-sidebar') ) return;
			
			 $(document).on('settings.ace.top_menu' , function(ev, event_name, fixed) {
				if( event_name !== 'sidebar_fixed' ) return;
			
				var sidebar = $sidebar.get(0);
				var $window = $(window);
			
				//return if sidebar is not fixed or in mobile view mode
				var sidebar_vars = $sidebar.ace_sidebar('vars');
				if( !fixed || ( sidebar_vars['mobile_view'] || sidebar_vars['collapsible'] ) ) {
					$sidebar.removeClass('lower-highlight');
					//restore original, default marginTop
					sidebar.style.marginTop = '';
			
					$window.off('scroll.ace.top_menu')
					return;
				}
			
			
				 var done = false;
				 $window.on('scroll.ace.top_menu', function(e) {
			
					var scroll = $window.scrollTop();
					scroll = parseInt(scroll / 4);//move the menu up 1px for every 4px of document scrolling
					if (scroll > 17) scroll = 17;
			
			
					if (scroll > 16) {			
						if(!done) {
							$sidebar.addClass('lower-highlight');
							done = true;
						}
					}
					else {
						if(done) {
							$sidebar.removeClass('lower-highlight');
							done = false;
						}
					}
			
					sidebar.style['marginTop'] = (17-scroll)+'px';
				 }).triggerHandler('scroll.ace.top_menu');
			
			 }).triggerHandler('settings.ace.top_menu', ['sidebar_fixed' , $sidebar.hasClass('sidebar-fixed')]);
			
			 $(window).on('resize.ace.top_menu', function() {
				$(document).triggerHandler('settings.ace.top_menu', ['sidebar_fixed' , $sidebar.hasClass('sidebar-fixed')]);
			 });
			
			
			});
		</script>
		
		<script type="text/javascript">
			jQuery(function($) {
				$('#id-input-file-2').ace_file_input({
					no_file:'No File ...',
					btn_choose:'Choose',
					btn_change:'Change',
					droppable:false,
					onchange:null,
					thumbnail:true //| true | large
					//whitelist:'gif|png|jpg|jpeg'
					//blacklist:'exe|php'
					//onchange:''
					//
				});
				//pre-show a file name, for example a previously selected file
				//$('#id-input-file-1').ace_file_input('show_file_list', ['myfile.txt'])
			});
		</script>

		<!-- the following scripts are used in demo only for onpage help and you don't need them -->
		<link rel="stylesheet" href="/assets/ace/css/ace.onpage-help.css" />
		<link rel="stylesheet" href="/assets/ace/js/themes/sunburst.css" />

		<script type="text/javascript"> ace.vars['base'] = '..'; </script>
		<script src="/assets/ace/js/ace/elements.onpage-help.js"></script>
		<script src="/assets/ace/js/ace/ace.onpage-help.js"></script>
		<script src="/assets/ace/js/rainbow.js"></script>
	</body>
</html>